package com.anb.app.demo.handler;

import com.anb.common.Log;
import com.anb.net.Connection;
import com.anb.net.Error;
import com.anb.proto.Common.Person;

public class Player {
    public static Person EchoPerson(Connection connection, Person person) throws Exception {
        Person person1 = Person.newBuilder().setId(5439).setName("hao").build();
        connection.requestAsync("Player.EchoPerson", person1, new Connection.ResponseHandler<Person>() {
            @Override
            public void success(Person person) {
                Log.Get().info(".................................." + person.getId() + "/" + person.getName());
            }
            @Override
            public void error(Error.Code error, Object obj) {
                Log.Get().info(error);
            }
        });
        return person;
    }
}
